<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page
	import="java.util.List,java.util.Map,java.util.LinkedHashMap,java.util.Iterator"%>
<%@ page import="com.xyrj.html.HHHtml"%>
<%@ page import="system.config.HHConfig"%>
<!-- 导入后台头部页面-->
<jsp:include page="common/header.jsp" />

<!-- 导入不支持Javascript提示 -->
<jsp:include page="common/noscript.html" />

<!-- 导入后台logo页面 -->
<jsp:include page="common/section.jsp" />

<!-- 导入控制面板 -->
<jsp:include page="common/sidebar.jsp" />

<!-- 主要页面  -->
<section id="main" class="column">
	<h2>
		欢迎
		<%=request.getSession().getAttribute("xyrj_user_name")%>
		回来～
	</h2>
	<p id="page-intro">接下来，你想进行什么操作?</p>
	<div class="content-box align-left dashboard">
		<ul class="shortcut-buttons-set">

			<li><a class="shortcut-button"
				href="<%=HHConfig.SITE_URL%>/index.jsp/admin/newsarticle/addview">
					<span> <img
						src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/images/icons/pencil_48.png"
						alt="icon" /><br /> 添加新闻
				</span></a></li>
			<li><a class="shortcut-button"
				href="<%=HHConfig.SITE_URL%>/index.jsp/admin/user/addview"><span>
						<img
						src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/images/icons/add_user_48.png"
						alt="icon" /><br /> 添加新用户
				</span></a></li>
			<li><a class="shortcut-button" href="#"><span> <img
						src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/images/icons/clock_48.png"
						alt="icon" /><br /> 系统配置
				</span></a></li>

			<li><a class="shortcut-button" href="#messages" rel="modal"><span>
						<img
						src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/images/icons/comment_48.png"
						alt="icon" /><br /> 查看最新消息
				</span></a></li>

		</ul>
		<!-- End .shortcut-buttons-set -->
	</div>
	<form
		action="<%=HHConfig.SITE_URL%>/index.jsp/admin/<%=request.getAttribute("modelEnName")%>/search"
		id="search_form_id" name="search_form" method="GET">
		<div class="content-box align-right search-area">
			<div class="content-box-header">
				<h3>
					搜索<%=request.getAttribute("modelZhName")%></h3>
			</div>
			<!-- End .content-box-header -->
			<div class="content-box-content">
				<div class="tab-content default-tab">
					<p>
						<input class="text-input short-input datepicker" type="text"
							id="keyword_id" name="keyword" title="关键字" value="请输入关键字..."
							autocomplete="off" /> <a href="javascript:void(0);"
							id="search_btn_id" class="button">搜索关键字</a> <br /> <br /> <small>说明：关键字支持名称或是ID，精确查找用：/ID，如:/12。</small>
					</p>
				</div>
				<!-- End #tab3 -->
			</div>
			<!-- End .content-box-content -->
		</div>
		<!-- End .content-box -->
	</form>
	<div class="clear"></div>
	<article class="module width_3_quarter">
		<header>
			<h3 class="tabs_involved"><%=request.getAttribute("modelZhName")%></h3>
			<ul class="tabs">
				<li><a href="#">信息列表</a></li>
			</ul>
		</header>
		<%
			String modelEnName = (String) request.getAttribute("modelEnName");
		%>
		<div class="tab_container">
			<div id="tab1" class="tab_content">
				<form name="list_form" id="list_form_id"
					action="<%=HHConfig.SITE_URL%>/index.jsp/admin/<%=modelEnName%>/operation"
					method="POST">
					<table class="tablesorter" cellspacing="0">
						<thead>
							<tr>
								<th><input class="check-all" type="checkbox" /></th>
								<%
									List<Map> list = (List<Map>) request.getAttribute("list");
									String[] showFields = (String[]) request.getAttribute("showFields");
									String[] showFieldNames = (String[]) request
											.getAttribute("showFieldNames");
									int totalCol = 2 + showFields.length;
								%>
								<%
									for (String name : showFieldNames) {
								%>
								<th><%=name%></th>
								<%
									}
								%>
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="record_list_area_id">
							<%
								if (null == list || 0 == list.size()) {
							%>
							<tr>
								<td class='txt-center-bold' colspan='<%=totalCol%>'>暂无记录</td>
							</tr>
							<%
								}
								for (int i = 0; null != list && i < list.size(); i++) {
									Map record = list.get(i);
							%>
							<tr>
								<td><input type="checkbox" name="record_id"
									value="<%=record.get(modelEnName + "_id")%>" /></td>
								<%
									for (String field : showFields) {
								%>
								<td><%=HHHtml.formatFieldValue(field, record.get(field))%></td>
								<%
									}
								%>
								<td>
									<!-- Icons --> <a
									href="<%=HHConfig.SITE_URL%>/index.jsp/admin/<%=modelEnName%>/editview?id=<%=record.get(modelEnName + "_id")%>"
									title="编辑"> <img
										src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/images/icn_edit.png"
										alt="编辑记录" />
								</a> <a
									href="<%=HHConfig.SITE_URL%>/index.jsp/admin/<%=modelEnName%>/delete?id=<%=record.get(modelEnName + "_id")%>"
									title="删除"> <img
										src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/images/icn_trash.png"
										alt="删除记录" />
								</a>
								</td>
							</tr>
							<%
								}
							%>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="<%=totalCol%>">
									<div class="bulk-actions align-right">
										<select name="operation" id="operation_id">
											<option value="">选择操作项目</option>
											<%
												Map<String, String> oprations = (LinkedHashMap<String, String>) request
														.getAttribute("oprations");
												Iterator iterator = oprations.keySet().iterator();
												while (iterator.hasNext()) {
													String value = (String) iterator.next();
											%>
											<option value="<%=value%>"><%=oprations.get(value)%></option>
											<%
												}
											%>
										</select> <a class="button" href="javascript:void(0);"
											id="exec_operation_id">执行操作</a>
									</div>
									<div class="pagination">
										<%=request.getAttribute("pageHtml")%>
									</div> <!-- End .pagination -->
									<div class="clear"></div>
								</td>
							</tr>
						</tfoot>
					</table>
				</form>
			</div>
			<!-- end of #tab1 -->
		</div>
		<!-- end of .tab_container -->
	</article>
	<!-- end of content manager article -->
	<div class="clear"></div>
</section>
<!-- end of section -->
<script type="text/javascript"
	src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/render/lightbox/jquery.lightbox-0.5.min.js"></script>
<script type="text/javascript"
	src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/common/js/hhjslib.hhbindrender.js"></script>
<script type="text/javascript"
	src="<%=HHConfig.SITE_URL + "/" + HHConfig.TPL_PATH%>/admin/js/list_form.js"></script>
</body>
</html>